package com.ant.myagile

import com.ant.myagile.backlog.Sprint


class Team {
	String teamName
	String logo
	String mailGroup
	String description
	Date establishedDate
	Member owner

	static constraints = {
		teamName(blank:false, nullable: false)
		logo( nullable: true)
		mailGroup(blank:false, nullable: false, email: true)
		description( nullable: true)
		owner nullable:true
		establishedDate nullable: true 
	}
	static mapping = {
		id column: 'teamId'
		version(false)
		teamMembers sort:'id', order:'asc'
		sprints sort : 'id', order : 'asc'
	}
	
	
	@Override
	public String toString() {
		return teamName
	}

	static belongsTo = [owner: Member]
	static hasMany = [teamMembers: Team_Member, teamProjects : Team_Project, sprints : Sprint]
}
